package com.zzzy.doc.controller.common;


import com.zzzy.common.vo.AjaxResult;
import com.zzzy.common.vo.PageResult;
import com.zzzy.sys.api.DeptApi;
import com.zzzy.sys.dto.DeptInfoDto;
import com.zzzy.sys.vo.DeptSelectPageReq;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springdoc.api.annotations.ParameterObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@Tag(name = "选择部门", description = "doc800")
@Validated
@RestController
@RequestMapping("/doc/deptSelect")
public class DeptSelectController {

    @Autowired
    private DeptApi deptApi;

    @GetMapping(value = "/page")
    @Operation(summary = "分页列表")
    public AjaxResult<PageResult<DeptInfoDto>> page(@Valid @ParameterObject DeptSelectPageReq queryReq) {
        PageResult<DeptInfoDto> deptSelectPage = deptApi.deptSelectPage(queryReq);
        return AjaxResult.success(deptSelectPage);
    }
}
